function binarySearch<T>(arr: T[], target: T): number {
  if (!arr.length) return -1;

  const result = arr.findIndex((item) => item === target);

  return result;
}

console.log(binarySearch<string>(["1", "2", "3", "4", "5", "6"], "8"));

export {};
